Optimal. Leaf size=69 \[ -\frac {a^2 (A b-a B)}{b^4 (a+b x)}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}+\frac {x (A b-2 a B)}{b^3}+\frac {B x^2}{2 b^2} \]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {77} \begin {gather*} -\frac {a^2 (A b-a B)}{b^4 (a+b x)}+\frac {x (A b-2 a B)}{b^3}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}+\frac {B x^2}{2 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rubi steps
\begin {align*} \int \frac {x^2 (A+B x)}{(a+b x)^2} \, dx &=\int \left (\frac {A b-2 a B}{b^3}+\frac {B x}{b^2}-\frac {a^2 (-A b+a B)}{b^3 (a+b x)^2}+\frac {a (-2 A b+3 a B)}{b^3 (a+b x)}\right ) \, dx\\ &=\frac {(A b-2 a B) x}{b^3}+\frac {B x^2}{2 b^2}-\frac {a^2 (A b-a B)}{b^4 (a+b x)}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 66, normalized size = 0.96 \begin {gather*} \frac {\frac {2 a^2 (a B-A b)}{a+b x}+2 b x (A b-2 a B)+2 a (3 a B-2 A b) \log (a+b x)+b^2 B x^2}{2 b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^2 (A+B x)}{(a+b x)^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.35, size = 113, normalized size = 1.64 \begin {gather*} \frac {B b^{3} x^{3} + 2 \, B a^{3} - 2 \, A a^{2} b - {\left (3 \, B a b^{2} - 2 \, A b^{3}\right )} x^{2} - 2 \, {\left (2 \, B a^{2} b - A a b^{2}\right )} x + 2 \, {\left (3 \, B a^{3} - 2 \, A a^{2} b + {\left (3 \, B a^{2} b - 2 \, A a b^{2}\right )} x\right )} \log \left (b x + a\right )}{2 \, {\left (b^{5} x + a b^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.03, size = 111, normalized size = 1.61 \begin {gather*} \frac {{\left (b x + a\right )}^{2} {\left (B - \frac {2 \, {\left (3 \, B a b - A b^{2}\right )}}{{\left (b x + a\right )} b}\right )}}{2 \, b^{4}} - \frac {{\left (3 \, B a^{2} - 2 \, A a b\right )} \log \left (\frac {{\left | b x + a \right |}}{{\left (b x + a\right )}^{2} {\left | b \right |}}\right )}{b^{4}} + \frac {\frac {B a^{3} b^{2}}{b x + a} - \frac {A a^{2} b^{3}}{b x + a}}{b^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 84, normalized size = 1.22 \begin {gather*} \frac {B \,x^{2}}{2 b^{2}}-\frac {A \,a^{2}}{\left (b x +a \right ) b^{3}}-\frac {2 A a \ln \left (b x +a \right )}{b^{3}}+\frac {A x}{b^{2}}+\frac {B \,a^{3}}{\left (b x +a \right ) b^{4}}+\frac {3 B \,a^{2} \ln \left (b x +a \right )}{b^{4}}-\frac {2 B a x}{b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.01, size = 74, normalized size = 1.07 \begin {gather*} \frac {B a^{3} - A a^{2} b}{b^{5} x + a b^{4}} + \frac {B b x^{2} - 2 \, {\left (2 \, B a - A b\right )} x}{2 \, b^{3}} + \frac {{\left (3 \, B a^{2} - 2 \, A a b\right )} \log \left (b x + a\right )}{b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.33, size = 77, normalized size = 1.12 \begin {gather*} x\,\left (\frac {A}{b^2}-\frac {2\,B\,a}{b^3}\right )+\frac {B\,x^2}{2\,b^2}+\frac {B\,a^3-A\,a^2\,b}{b\,\left (x\,b^4+a\,b^3\right )}+\frac {\ln \left (a+b\,x\right )\,\left (3\,B\,a^2-2\,A\,a\,b\right )}{b^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.42, size = 68, normalized size = 0.99 \begin {gather*} \frac {B x^{2}}{2 b^{2}} + \frac {a \left (- 2 A b + 3 B a\right ) \log {\left (a + b x \right )}}{b^{4}} + x \left (\frac {A}{b^{2}} - \frac {2 B a}{b^{3}}\right ) + \frac {- A a^{2} b + B a^{3}}{a b^{4} + b^{5} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________